<template>
  <div class="block">
    <span class="demonstration">单选可搜索</span>
    <el-cascader placeholder="试试搜索：专业名" :options="optionsExample" filterable></el-cascader>
    <h5>{{test}}</h5>
  
  </div>
</template>

<script>

import service from '@/api/config'

export default {
  name: "SearchChoice",
  data() {
    return {
      test: "http://localhost:8080/el/search",
      optionsExample: [
        {
          value: "zhinan",
          label: "指南",
          children: [
            {
              value: "shejiyuanze",
              label: "设计原则",
              children: [
                {
                  value: "yizhi",
                  label: "一致",
                  children: [
                    {
                      label: "儿子"
                    }
                  ]
                },
                {
                  value: "fankui",
                  label: "反馈"
                },
                {
                  value: "xiaolv",
                  label: "效率"
                },
                {
                  value: "kekong",
                  label: "可控"
                }
              ]
            },
            {
              value: "daohang",
              label: "导航",
              children: [
                {
                  value: "cexiangdaohang",
                  label: "侧向导航"
                },
                {
                  value: "dingbudaohang",
                  label: "顶部导航"
                }
              ]
            }
          ]
        }
      ]
    };
  },
  method: {
    // TODO: 生成选项列表
    generateOpitions(){
      return {};
    }
    // https://api.scu.plus/sua/v2/student/training_scheme
    // authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImViMDY4ZWJhODM5Mzg2NzA1NDBmZTI2MDJiYjZhMjc1NmUyYjAwYzJlMTUzNzM5ZDY2NjNhNDUyYWJiNjU2MDAiLCJjbGllbnQiOnsidmVyc2lvbiI6IjAuMTAuMiIsInR5cGUiOiJ1cnAifSwiaWF0IjoxNTk3MTU3NTg5LCJleHAiOjE1OTcxNzkxODl9.ZwEQVfIb6udojVfyxT8wxjAl9LptCcmvHYqVssRsStA
    // user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3775.400 QQBrowser/10.6.4208.400
  },
  mounted(){
    this.$http
      .get('https://api.scu.plus/sua/v2/student/training_scheme')
      .then((res)=>{
        this.test = res;
      })
  }
};
</script>